<?php
// +----------------------------------------------------------------------
// | 请求方式集合
// +----------------------------------------------------------------------
// | Author: TongBC <501468940@qq.com>
// +----------------------------------------------------------------------
// | Date  : 2015/09/25
// +----------------------------------------------------------------------
// | 特别说明：个人文件，请勿修改，如需修改，请继承或联系本人
// +----------------------------------------------------------------------
class Request{
	
	public static function Fsockopen_Zero_Wait($url, $data, $method='POST'){
		$pams = trim(http_build_query($data));  
		$lens = strlen($pams);
		$info = parse_url($url);
		$fp   = fsockopen($info["host"], 80, $errno, $errstr, 8);
		$qury = isset($info["query"]) ? $info["query"]:'';
		$head = strtoupper($method)." ".$info['path']."?".$qury." HTTP/1.0\r\n";
		$head.= "Host: ".$info['host']."\r\n";
		$head.= "Referer: http://".$info['host'].$info['path']."\r\n";
		$head.= "Content-type: application/x-www-form-urlencoded\r\n";
		$head.= "Content-Length: ".$lens."\r\n";
		$head.= "\r\n";
		$head.= $pams;
		$write = fputs($fp, $head);
	}
}